/**   
 * api接口统一管理
 */
import { get, post, deleteFn, getAllURL,postAllURL } from './index'



// export const getData = (params) => get("/trafficForecastDay/getData", params);
// export const updateOperateConf = (params) => post("wlmq/main/updateOperate", params);
// export const prediction = (params) => post("", params);
// let path1 = 'portal/metadata-atomic/api/2.0/metadata/'
let path1 = 'http://10.1.1.36:15469/api/2.0/metadata/'



// let path2 = '/portal/metadata-atomic/hbdata/metaDataIndex/'
let path3 = '/hbdata/metaDataIndex/'

// let path2 = '/portal/metadata-atomic/hbdata/metaDataIndex/'
let path2 = 'http://10.1.1.36:15469/hbdata/metaDataIndex'



// export const addML = (params) => post(path2 + "add", params);
// export const editML = (params) => post(path2 + "edit", params);
// export const deleteML = (params) => deleteFn(path2 + "delete", params);
// export const loadTreeRootML = (params) => get(path2 + "loadTreeRoot", params);
// export const loadTreeChildrenML = (params) => get(path2 + "loadTreeChildren", params);





//查询下级目录
export const getXJML = (params) => get(path1 + "Schema/10001/children?withTableInCategory=false", params);
//根据目录查询下级表  /  也可以做校验
export const getMLCXB = (params) => get(path1 + "table/category/a2ecd088-ebc1-468b-92a2-909cf1d25f96/tables", params);
//首页-亚丽

export const getSynum = (params) => getAllURL("http://10.1.1.9:16321/api/2.0/metadata/DataHome/getSynum", params);
export const getSyApplynum = (params) => getAllURL("http://10.1.1.9:16321/api/2.0/metadata/DataHome/getSyApplynum", params);
export const getSearDetail = (params) => getAllURL("http://10.1.1.9:16321/api/2.0/metadata/DataAssets/getSearDetail", params);
export const getSearPart = (params) => getAllURL("http://10.1.1.9:16321/api/2.0/metadata/DataAssets/getSearPart", params);

//根据目录获取数据列表接口-鹏程
export const mlGetBiao = (params) => getAllURL("http://10.1.1.36:15469/api/2.0/metadata/db-info/query", params);
export const mlGetBiaoDetail = (params) => getAllURL("http://10.1.1.36:15469/api/2.0/metadata/db-info/detail", params);


// export const getSynum = (params) => getAllURL(path1+"/DataHome/getSynum", params);
// export const getSyApplynum = (params) => getAllURL(path1+"/DataHome/getSyApplynum", params);

// //根据目录获取数据列表接口-鹏程
// export const mlGetBiao = (params) => getAllURL(path1+"/db-info/query", params);

//修改保存数据源信息接口-鹏程
export const editBiao = (params) => getAllURL(path1+"/db-info/edit", params);
export const loadTreeRootML = (params) => getAllURL(path2+"/loadTreeRoot", params);
export const deleteML = (params) => getAllURL(path2+"/delete", params);
export const editML = (params) => postAllURL(path2+"/edit", params);
export const addML = (params) => postAllURL(path2+"/add", params);





// 上传文件
export const  fileUrl = `${path1}data-import/excel/Upload`;
// 保存文件
export const perform = ({ transactionId, categoryId}) => post(path1 + "data-import/excel/transaction/perform", {},{
    transactionId,
    categoryId
});
